<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>工程合同进度查询</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../resources/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../resources/css/style.css" media="all">
    <style>
        .layui-input-inline{width: 80%;}
        /*.layui-form-item .layui-input-inline{width: 165px;}*/
        .masksx .forms{padding-left: 0;text-align: center;}
        .masksx{width: 500px;height:50%;}
        .mask input{width: 100%!important;}
        .mask .layui-select-title{width: 480px;}
        .masksx .layui-input-inline{width: 58%!important;}
        /*.layui-inline{margin-bottom: 10px;}*/
        .layui-upload{ text-align: left;}
        .layui-form-item{margin-bottom: 0;}
        #demo2 img{width: 120px; height: 120px;}
        .imgs{position: relative;width: 120px; height: 120px; float: left;}
        ._ingshan{position: absolute;right: 0px;top: 0px;border: 1px solid #E3e3e3;
            border-radius: 50%;width: 20px;height: 20px;text-align: center;}
        @media only screen and (min-width: 321px) and (max-width: 1024px) {
            .layui-form-pane .layui-input-inline {width: 80%!important;}
            ._inkong{ width:auto!important; }
            .layui-form-item .layui-input-inline{width: 80%!important;}
            .masksx{height: 70%;}
        }
        .layui-form-label{padding-left: 0;height:20px;}
        .layui-input-inline{width: 80%!important;}
        .masksx .layui-inline{margin-bottom: 10px;}
        ._submit{margin-top: 10px; margin-bottom: 10px;}
    </style>
</head>
<body>
<div class="_PC">
    <a class="dayin" type="button" id="dlink"  style="float: right; position: fixed; right: 50px; bottom: 50px; z-index: 999;"></a>
    <form class="layui-form layui-form-pane" action="" >
        <div class="formTop" style="font-size:12px;">
            <div class="layui-form-item layui-col-lg3 layui-col-sm3 layui-col-xs3">
                <div class="layui-input-inline">
                    <input type="text" name="username" lay-verify="required" placeholder="项目名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline layui-col-lg3 layui-col-sm3 layui-col-xs3">
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="test-limit3" placeholder="请选择开始日期">
                    <div class="icons">

                    </div>
                </div>
            </div>
            <div class="layui-inline layui-col-lg3 layui-col-sm3 layui-col-xs3">

                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="test-limit4" placeholder="请选择结束日期">
                    <div class="icons">

                    </div>
                </div>
            </div>

            <div class="layui-col-lg2 layui-col-sm2">
                <button class="layui-btn tijiao" type="button" onclick="query()">查询</button>

            </div>

        </div>

        <table id="demo" lay-filter="test"></table>

        <script type="text/html" id="barDemo">
            <a class="layui-btn layui-btn-sm chakan quanxian layui-btn-xs" lay-event="detail" QX="api/contract/loadContractDetails.do">查看</a>
            {{#  if(d.cc_vali > 0 ){ }}
            <a class="layui-btn layui-btn-sm  layui-btn-danger layui-btn-xs" lay-event="bianji"     >合同接收</a>
            {{#  } }}
        </script>


    </form>
    <div class="mask">
        <div class="masksx">
            <div class="title"><span class="titleL">申请签证</span><span class="close">×</span></div>
            <div class="forms">
                <form class="layui-form addUser" method="post" action="">


                    <div class="layui-inline">
                        <label class="layui-form-label"><span class="bixuan">*</span>接收人:</label>
                        <div class="layui-input-inline _inkong" style="width: 350px;">
                            <input type="text" name="cc_recperson" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">

                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label"><span class="bixuan">*</span>送达时间:</label>
                        <div class="layui-input-inline _inkong" style="width: 350px;">
                            <input type="text" name="cc_rectime" id="date" lay-verify="date|required" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">

                        </div>
                    </div>
                    <div class="_submit" style="text-align: center;">
                        <button class="layui-btn layui-btn-sm tijiao" lay-submit lay-filter="_subm" style="margin-right: 20px;">提交</button>
                    </div>

                </form>

            </div>
        </div>

    </div>
</div>





<script src="../../../resources/layui/layui.js" charset="utf-8"></script>
<script src="../../../resources/js/style.js"></script>
<script src="../../../resources/js/api.js"></script>
<script>

    function query() {
        layui.use(['form', 'layedit', 'laydate','table','element'], function() {
            var form = layui.form
                , table = layui.table;
            var pronName=$("[name='username']").val();
            var begintime=$('#test-limit3').val();
            var endtime=$('#test-limit4').val();
            var state=$('[name="quiz1"]').val();




            if(!AntiSqlValid(pronName)){
                if(lbq('api/contract/builConProcessList.do')){
                API.hetongjindu({'proName':pronName,'begintime':begintime,'endtime':endtime,'state':state,'p':getCookie('yanzheng')})
                }
            }else {
                layer.msg('请勿输入特殊符号或敏感文字');
            };
        })

    }


    layui.use(['form', 'layedit', 'laydate','table','laytpl','flow'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,table=layui.table
            ,laytpl=layui.laytpl
            ,flow=layui.flow
            ,laydate = layui.laydate;
        jiazais();

        //前后若干天可选，这里设置不能选过去的日期      最远可选1000天之后
        panduanshijiantow('#test-limit3','#test-limit4',1000,1000,'.tijiao');     //查询 开始结束时间判断

        if(lbq('api/contract/builConProcessList.do')) {

            API.hetongjindu({'p': getCookie('yanzheng')})            //获取到的数据传入列表进行渲染
        }
        $('.close').click(function () {     //遮罩层隐藏
            $('.mask').hide();
        })

        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#dates'
        });
        var ccuid='';
        //监听工具条
        table.on('tool(test)', function(obj){ //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
            var data = obj.data; //获得当前行数据
            var layEvent = obj.event; //获得 lay-event 对应的值
            var tr = obj.tr; //获得当前行 tr 的DOM对象

            if(layEvent === 'detail'){ //查看
                //do somehing
                //console.log(obj)

                sessionStorage.id=obj.data.cc_UUID;         //缓存id 至详情页调用
                window.location.href='../../management/contracrAdmin/details.html';
            }  else if(layEvent === 'bianji'){ //编辑
                //do something
                //console.log(obj)
                ccuid=obj.data.cc_UUID;
                $('.mask').show();
                $('.titleL').html('纸质送回状态');

            }
        });

        form.on('submit(_subm)',function (data) {
            //console.log(data.field)

            data.field.p=getCookie('yanzheng');
            data.field.cc_uuid=ccuid;
            formAlertAjax('/api/contract/editBuilProcess.do',data.field,'.tijiao');


            return false;
        })

        dayintishi('.dayin');






    })

</script>
</body>
</html>